package org.zht.dormpro.dorm.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.dorm.bean.DormDTO;
import org.zht.dormpro.dorm.model.TbDorm;

import java.util.List;

public interface TbDormMapper {
    @Delete({
        "delete from tb_dorm",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    int insertSelective(TbDorm record);

    @Select({
        "select",
        "id, dorm_id, floor_id, dorm_name, dorm_type, dorm_status, dorm_append",
        "from tb_dorm",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("org.zht.dormpro.dorm.mapper.TbDormMapper.ResultMapWithBLOBs")
    TbDorm selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbDorm record);

    List<TbDorm> getAllDorm(@Param("all")Integer all);

    List<DormDTO> getAllDormByCondition(PageBean pageBean);

    List<TbDorm> getAllDormByFloorId(String floorId);
}